{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 91,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "              ip_1                  com                          time  num_1  \\\n",
      "0    112.84.34.103  cnki.cdn.bcebos.com  [12/Sep/2018:19:00:08 +0800]     68   \n",
      "1  180.163.198.103  cnki.cdn.bcebos.com  [12/Sep/2018:19:00:58 +0800]     87   \n",
      "2   120.199.69.105  cnki.cdn.bcebos.com  [12/Sep/2018:19:00:22 +0800]     38   \n",
      "3      39.129.5.43  cnki.cdn.bcebos.com  [12/Sep/2018:19:00:22 +0800]    102   \n",
      "4   120.199.69.105  cnki.cdn.bcebos.com  [12/Sep/2018:19:00:01 +0800]     42   \n",
      "\n",
      "                              get  404  num_2  num_3  \\\n",
      "0  GET /2018CUMCM-AB.rar HTTP/1.1  404    600    117   \n",
      "1       GET /favicon.ico HTTP/1.1  404    615    117   \n",
      "2     GET /CUMCM2018.exe HTTP/1.1  404    600    117   \n",
      "3     GET /CUMCM2018.exe HTTP/1.1  404    521    117   \n",
      "4     GET /CUMCM2018.exe HTTP/1.1  404    600    117   \n",
      "\n",
      "                                                 url  \\\n",
      "0  http://cumcm.cnki.net/cumcm//studentHome/stude...   \n",
      "1           http://cnki.cdn.bcebos.com/CUMCM2018.exe   \n",
      "2  http://cumcm.cnki.net/cumcm//studentHome/stude...   \n",
      "3  http://cumcm.cnki.net/cumcm//studentHome/stude...   \n",
      "4  http://cumcm.cnki.net/cumcm//studentHome/stude...   \n",
      "\n",
      "                                                guid  \\\n",
      "0                                                  -   \n",
      "1  __guid=141700960.2294804920719535600.153675005...   \n",
      "2                                                  -   \n",
      "3                                                  -   \n",
      "4  __guid=141700960.2174463798317252900.153674815...   \n",
      "\n",
      "                                             browser  \\\n",
      "0  Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKi...   \n",
      "1  Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebK...   \n",
      "2  Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebK...   \n",
      "3  Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebK...   \n",
      "4  Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebK...   \n",
      "\n",
      "                          ip_2     num_4  miss          ip_3  \n",
      "0    220.195.66.7,116.95.27.55   5547950  MISS   58.216.2.35  \n",
      "1               180.160.145.51   9110420  MISS  111.177.3.35  \n",
      "2     39.129.5.43,222.56.79.50   5546388  MISS   58.216.2.35  \n",
      "3                            -  11611314  MISS  222.56.79.35  \n",
      "4  183.230.27.8,183.230.68.105   5568853  MISS   58.216.2.35  \n",
      "               ip_1                  com                          time  num_1  \\\n",
      "295  223.111.127.50  cnki.cdn.bcebos.com  [12/Sep/2018:19:02:01 +0800]     97   \n",
      "296  120.199.69.103  cnki.cdn.bcebos.com  [12/Sep/2018:19:02:30 +0800]     36   \n",
      "297  117.181.20.231  cnki.cdn.bcebos.com  [12/Sep/2018:19:02:49 +0800]    125   \n",
      "298   36.104.142.50  cnki.cdn.bcebos.com  [12/Sep/2018:19:02:39 +0800]     70   \n",
      "299   180.76.22.115  cnki.cdn.bcebos.com  [12/Sep/2018:19:02:32 +0800]     42   \n",
      "\n",
      "                                get  404  num_2  num_3  \\\n",
      "295     GET /CUMCM2018.exe HTTP/1.1  404    615    117   \n",
      "296  GET /2018CUMCM-AB.rar HTTP/1.1  404    600    117   \n",
      "297     GET /CUMCM2018.exe HTTP/1.1  404    521    117   \n",
      "298     GET /CUMCM2018.exe HTTP/1.1  404    614    117   \n",
      "299       GET /favicon.ico HTTP/1.1  404    600    117   \n",
      "\n",
      "                                                   url guid  \\\n",
      "295  http://cumcm.cnki.net/cumcm//studentHome/stude...    -   \n",
      "296  http://cumcm.cnki.net/cumcm//studentHome/stude...    -   \n",
      "297  http://cumcm.cnki.net/cumcm//studentHome/stude...    -   \n",
      "298  http://cumcm.cnki.net/cumcm//studentHome/stude...    -   \n",
      "299                                                  -    -   \n",
      "\n",
      "                                               browser  \\\n",
      "295  Mozilla/5.0 (Windows NT 10.0; Win64; x64) Appl...   \n",
      "296  Mozilla/5.0 (Windows NT 10.0; Win64; x64) Appl...   \n",
      "297  Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKi...   \n",
      "298  Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebK...   \n",
      "299  Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:6...   \n",
      "\n",
      "                               ip_2      num_4  miss          ip_3  \n",
      "295                  117.136.45.101    6117329  MISS  111.63.51.35  \n",
      "296       222.34.4.4,183.216.160.78    5591352  MISS   58.216.2.35  \n",
      "297                               -   15519059  MISS  111.6.225.35  \n",
      "298                   36.104.40.199  408814438  MISS   42.81.93.35  \n",
      "299  111.117.112.177,222.199.191.63    5608958  MISS   58.216.2.35  \n"
     ]
    }
   ],
   "source": [
    "import pandas as pd\n",
    "\n",
    "# 将csv文件转化成DataFrame格式\n",
    "thh_log = pd.read_csv('G:\\\\PyCharm\\\\PythonProjects\\\\pro01\\\\test\\\\thh_log.csv',names = ['ip_1','com','time','num_1','get',\n",
    "                                             '404','num_2', 'num_3','url', 'guid',\n",
    "                                             'browser','ip_2','num_4','miss','ip_3'])\n",
    "print(thh_log.head())\n",
    "print(thh_log.tail())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'111.1.52.50',\n",
       " '111.1.52.75',\n",
       " '111.1.52.78',\n",
       " '111.117.112.177',\n",
       " '111.177.3.103',\n",
       " '111.177.3.105',\n",
       " '111.177.3.115',\n",
       " '111.20.242.50',\n",
       " '111.6.225.50',\n",
       " '111.6.225.55',\n",
       " '111.6.225.63',\n",
       " '111.62.0.103',\n",
       " '111.62.0.105',\n",
       " '111.63.51.103',\n",
       " '111.63.51.105',\n",
       " '112.224.75.103',\n",
       " '112.45.121.50',\n",
       " '112.45.121.75',\n",
       " '112.45.121.78',\n",
       " '112.84.34.103',\n",
       " '112.84.34.105',\n",
       " '112.84.34.115',\n",
       " '112.84.34.116',\n",
       " '112.96.179.170',\n",
       " '113.200.85.153',\n",
       " '115.154.23.13',\n",
       " '116.95.27.55',\n",
       " '117.136.0.210',\n",
       " '117.136.45.101',\n",
       " '117.136.66.218',\n",
       " '117.136.8.230',\n",
       " '117.136.87.33',\n",
       " '117.152.221.42',\n",
       " '117.181.20.231',\n",
       " '117.61.137.101',\n",
       " '119.188.176.103',\n",
       " '119.188.176.105',\n",
       " '119.188.176.115',\n",
       " '119.188.176.116',\n",
       " '120.199.69.103',\n",
       " '120.199.69.105',\n",
       " '123.138.42.50',\n",
       " '123.139.42.195',\n",
       " '123.184.220.50',\n",
       " '125.41.236.58',\n",
       " '125.64.99.103',\n",
       " '139.215.221.50',\n",
       " '157.255.172.20',\n",
       " '157.255.172.22',\n",
       " '163.177.8.105',\n",
       " '163.177.8.95',\n",
       " '180.160.145.51',\n",
       " '180.163.198.103',\n",
       " '180.163.198.105',\n",
       " '180.76.22.115',\n",
       " '180.76.22.186',\n",
       " '180.76.22.232',\n",
       " '183.216.160.50',\n",
       " '183.216.160.75',\n",
       " '183.216.160.78',\n",
       " '183.230.27.8',\n",
       " '183.230.68.105',\n",
       " '202.121.181.104',\n",
       " '202.98.17.207',\n",
       " '218.89.243.64',\n",
       " '219.147.233.50',\n",
       " '219.147.233.63',\n",
       " '219.216.176.154',\n",
       " '219.224.52.129',\n",
       " '219.228.146.115',\n",
       " '220.195.66.7',\n",
       " '221.0.95.244',\n",
       " '221.176.187.237',\n",
       " '221.180.244.50',\n",
       " '221.195.34.105',\n",
       " '222.199.191.50',\n",
       " '222.199.191.55',\n",
       " '222.199.191.63',\n",
       " '222.34.4.4',\n",
       " '222.56.79.50',\n",
       " '223.111.127.50',\n",
       " '223.111.127.75',\n",
       " '223.111.127.78',\n",
       " '223.87.229.217',\n",
       " '27.45.53.139',\n",
       " '36.104.142.50',\n",
       " '36.104.142.63',\n",
       " '36.104.40.199',\n",
       " '36.22.155.247',\n",
       " '36.27.216.63',\n",
       " '36.27.216.68',\n",
       " '39.129.5.43',\n",
       " '39.174.128.178',\n",
       " '42.185.150.80',\n",
       " '42.81.93.105',\n",
       " '42.81.93.115',\n",
       " '58.194.168.69',\n",
       " '58.215.118.105',\n",
       " '58.215.118.115',\n",
       " '58.215.118.78',\n",
       " '58.215.98.50',\n",
       " '58.215.98.75',\n",
       " '58.215.98.78',\n",
       " '58.218.185.110',\n",
       " '58.218.185.160',\n",
       " '59.45.22.139',\n",
       " '61.151.178.180',\n",
       " '61.238.139.186'}"
      ]
     },
     "execution_count": 43,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ip_list = []\n",
    "for item in thh_log['ip_1']:\n",
    "    ip_list.append(item)\n",
    "# final_list=list(set(ip_list))\n",
    "# len(final_list)    \n",
    "set(ip_list)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 300 entries, 0 to 299\n",
      "Data columns (total 15 columns):\n",
      "ip_1       300 non-null object\n",
      "com        300 non-null object\n",
      "time       300 non-null object\n",
      "num_1      300 non-null int64\n",
      "get        300 non-null object\n",
      "404        300 non-null int64\n",
      "num_2      300 non-null int64\n",
      "num_3      300 non-null int64\n",
      "url        300 non-null object\n",
      "guid       300 non-null object\n",
      "browser    300 non-null object\n",
      "ip_2       300 non-null object\n",
      "num_4      300 non-null int64\n",
      "miss       300 non-null object\n",
      "ip_3       300 non-null object\n",
      "dtypes: int64(5), object(10)\n",
      "memory usage: 35.2+ KB\n"
     ]
    }
   ],
   "source": [
    "thh_log.info()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['ip_1',\n",
       " 'com',\n",
       " 'time',\n",
       " 'num_1',\n",
       " 'get',\n",
       " '404',\n",
       " 'num_2',\n",
       " 'num_3',\n",
       " 'url',\n",
       " 'guid',\n",
       " 'browser',\n",
       " 'ip_2',\n",
       " 'num_4',\n",
       " 'miss',\n",
       " 'ip_3']"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "thh_log.columns.values.tolist()\n",
    "# for nname in thh_log.columns.values.tolist():\n",
    "#     thh_log[nname].value_counts().shape\n",
    "# thh_log['ip_2'].value_counts().shape\n",
    "# thh_log['ip_3'].value_counts().shape\n",
    "# thh_log['miss'].value_counts().shape\n",
    "# thh_log['com'].value_counts().shape\n",
    "# thh_log['get'].value_counts().shape\n",
    "# thh_log['guid'].value_counts().shape\n",
    "# thh_log['num_1'].value_counts().shape\n",
    "# thh_log['num_2'].value_counts().shape\n",
    "# thh_log['num_3'].value_counts().shape\n",
    "# thh_log['num_4'].value_counts().shape\n",
    "# thh_log['404'].value_counts().shape\n",
    "# thh_log['url'].value_counts().shape\n",
    "# thh_log['browser'].value_counts().shape\n",
    "# thh_log['time'].value_counts().shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(1,)"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "\n",
    "thh_log['com'].value_counts().shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(10,)"
      ]
     },
     "execution_count": 45,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "thh_log['get'].value_counts().shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'GET / HTTP/1.1',\n",
       " 'GET /2018CUMCM-AB.rar HTTP/1.1',\n",
       " 'GET /2018CUMCM-AB.rar?nsukey=XqhvAC1ZP4N4dzXAQtNXrGGkm85IaFnZuiZVoG9IkVVeHWj2sexRM3UVgE483UjUNZhuMWhhCx6UMTYc5H0e%2BFZ9znyY%2F3o93ZFJfmt63cv4Cc0g91jGZqb%2Bfbsrv8BTZmBoZoglcITMbU2pcVbEVOE3pjI538UlPnxBfFIqgoLJy0axRyX4%2BMB5nGKq3lsymL3qU8D9JZg6QobD3s3LoA%3D%3D HTTP/1.1',\n",
       " 'GET /2018CUMCM-AB.rar?nsukey=XqhvAC1ZP4N4dzXAQtNXrGGkm85IaFnZuiZVoG9IkVVeHWj2sexRM3UVgE483UjUNZhuMWhhCx6UMTYc5H0e2BFZ9znyY2F3o93ZFJfmt63cv4Cc0g91jGZqb2Bfbsrv8BTZmBoZoglcITMbU2pcVbEVOE3pjI538UlPnxBfFIqgoLJy0axRyX42BMB5nGKq3lsymL3qU8D9JZg6QobD3s3LoA3D3D HTTP/1.1',\n",
       " 'GET /2018CUMCM-CD.rar HTTP/1.1',\n",
       " 'GET /CUMCM2018.exe HTTP/1.1',\n",
       " 'GET /CUMCM2018.exe?nsukey=%2BEmC20U5GaAE%2FmRz6ipFr7f6BCb5R%2FT07QotSTkLND0trzhUZKRCala93NI0a9mOtoX61gDU2NtlOX6pbmJy6jWtFhP1y0QbhfvM4ZvXw4upn8UO1GQOI7l8ZmkPniC%2F9E8tXaEYb9umh40UViA4D0H635hVx509r%2BMnp1RvG63z2TJBrbCGW72nPSBH0wX9R1uVbk56UAJwShgNFWbJgw%3D%3D HTTP/1.1',\n",
       " 'GET /CUMCM2018.exe?nsukey=2BEmC20U5GaAE2FmRz6ipFr7f6BCb5R2FT07QotSTkLND0trzhUZKRCala93NI0a9mOtoX61gDU2NtlOX6pbmJy6jWtFhP1y0QbhfvM4ZvXw4upn8UO1GQOI7l8ZmkPniC2F9E8tXaEYb9umh40UViA4D0H635hVx509r2BMnp1RvG63z2TJBrbCGW72nPSBH0wX9R1uVbk56UAJwShgNFWbJgw3D3D HTTP/1.1',\n",
       " 'GET /favicon.ico HTTP/1.1',\n",
       " 'HEAD /CUMCM2018.exe HTTP/1.1'}"
      ]
     },
     "execution_count": 50,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "get_list = []\n",
    "for item in thh_log['get']:   \n",
    "    get_list.append(item)\n",
    "get_set = set(get_list)\n",
    "get_set\n",
    "\n",
    "#list(set(drop_dup_list))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'111.63.51.103': 12,\n",
       " '42.81.93.105': 10,\n",
       " '180.76.22.232': 9,\n",
       " '36.104.40.199': 9,\n",
       " '120.199.69.103': 9,\n",
       " '163.177.8.105': 8,\n",
       " '36.104.142.50': 8,\n",
       " '111.63.51.105': 8,\n",
       " '112.84.34.105': 8,\n",
       " '222.199.191.50': 7,\n",
       " '222.199.191.63': 7,\n",
       " '180.76.22.115': 7,\n",
       " '112.96.179.170': 6,\n",
       " '120.199.69.105': 6,\n",
       " '119.188.176.105': 6,\n",
       " '39.174.128.178': 5,\n",
       " '117.136.45.101': 5,\n",
       " '219.216.176.154': 5,\n",
       " '58.215.98.50': 5,\n",
       " '58.215.118.105': 5,\n",
       " '223.111.127.75': 4,\n",
       " '117.61.137.101': 4,\n",
       " '221.0.95.244': 4,\n",
       " '112.84.34.103': 3,\n",
       " '117.136.0.210': 3,\n",
       " '117.136.66.218': 3,\n",
       " '219.228.146.115': 3,\n",
       " '36.22.155.247': 3,\n",
       " '111.177.3.115': 3,\n",
       " '111.177.3.105': 3,\n",
       " '117.152.221.42': 3,\n",
       " '125.41.236.58': 3,\n",
       " '111.6.225.63': 3,\n",
       " '111.117.112.177': 3,\n",
       " '112.224.75.103': 3,\n",
       " '223.87.229.217': 3,\n",
       " '223.111.127.50': 2,\n",
       " '111.6.225.50': 2,\n",
       " '221.180.244.50': 2,\n",
       " '36.27.216.68': 2,\n",
       " '111.1.52.75': 2,\n",
       " '42.185.150.80': 2,\n",
       " '42.81.93.115': 2,\n",
       " '125.64.99.103': 2,\n",
       " '117.181.20.231': 2,\n",
       " '219.224.52.129': 2,\n",
       " '111.177.3.103': 2,\n",
       " '123.138.42.50': 2,\n",
       " '222.34.4.4': 2,\n",
       " '116.95.27.55': 2,\n",
       " '220.195.66.7': 2,\n",
       " '111.6.225.55': 2,\n",
       " '58.215.98.75': 2,\n",
       " '119.188.176.115': 2,\n",
       " '111.1.52.50': 2,\n",
       " '180.160.145.51': 2,\n",
       " '223.111.127.78': 2,\n",
       " '180.163.198.103': 2,\n",
       " '61.238.139.186': 2,\n",
       " '180.76.22.186': 2,\n",
       " '115.154.23.13': 2,\n",
       " '58.215.118.115': 2,\n",
       " '183.216.160.78': 2,\n",
       " '58.194.168.69': 2,\n",
       " '117.136.8.230': 2,\n",
       " '112.84.34.115': 2,\n",
       " '183.216.160.75': 2,\n",
       " '218.89.243.64': 2,\n",
       " '221.176.187.237': 1,\n",
       " '112.84.34.116': 1,\n",
       " '139.215.221.50': 1,\n",
       " '58.218.185.160': 1,\n",
       " '111.1.52.78': 1,\n",
       " '27.45.53.139': 1,\n",
       " '222.199.191.55': 1,\n",
       " '117.136.87.33': 1,\n",
       " '183.230.27.8': 1,\n",
       " '180.163.198.105': 1,\n",
       " '36.27.216.63': 1,\n",
       " '113.200.85.153': 1,\n",
       " '183.230.68.105': 1,\n",
       " '157.255.172.20': 1,\n",
       " '39.129.5.43': 1,\n",
       " '58.218.185.110': 1,\n",
       " '123.139.42.195': 1,\n",
       " '219.147.233.63': 1,\n",
       " '221.195.34.105': 1,\n",
       " '111.62.0.103': 1,\n",
       " '36.104.142.63': 1,\n",
       " '61.151.178.180': 1,\n",
       " '202.98.17.207': 1,\n",
       " '157.255.172.22': 1,\n",
       " '58.215.118.78': 1,\n",
       " '112.45.121.75': 1,\n",
       " '59.45.22.139': 1,\n",
       " '202.121.181.104': 1,\n",
       " '119.188.176.116': 1,\n",
       " '112.45.121.78': 1,\n",
       " '123.184.220.50': 1,\n",
       " '111.62.0.105': 1,\n",
       " '183.216.160.50': 1,\n",
       " '219.147.233.50': 1,\n",
       " '163.177.8.95': 1,\n",
       " '112.45.121.50': 1,\n",
       " '119.188.176.103': 1,\n",
       " '58.215.98.78': 1,\n",
       " '222.56.79.50': 1,\n",
       " '111.20.242.50': 1}"
      ]
     },
     "execution_count": 56,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ip_num = dict(thh_log['ip_1'].value_counts())\n",
    "# type(ip_num)  dict\n",
    "# len(ip_num)  108\n",
    "ip_num\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2"
      ]
     },
     "execution_count": 60,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sum = 0\n",
    "ip_num['111.1.52.50']\n",
    "# for i in ip_num[len(ip_num)][]:\n",
    "#     sum += n\n",
    "# n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'GET /CUMCM2018.exe HTTP/1.1': 155,\n",
       " 'GET /favicon.ico HTTP/1.1': 87,\n",
       " 'GET /2018CUMCM-AB.rar HTTP/1.1': 40,\n",
       " 'HEAD /CUMCM2018.exe HTTP/1.1': 3,\n",
       " 'GET /2018CUMCM-CD.rar HTTP/1.1': 3,\n",
       " 'GET /2018CUMCM-AB.rar?nsukey=XqhvAC1ZP4N4dzXAQtNXrGGkm85IaFnZuiZVoG9IkVVeHWj2sexRM3UVgE483UjUNZhuMWhhCx6UMTYc5H0e%2BFZ9znyY%2F3o93ZFJfmt63cv4Cc0g91jGZqb%2Bfbsrv8BTZmBoZoglcITMbU2pcVbEVOE3pjI538UlPnxBfFIqgoLJy0axRyX4%2BMB5nGKq3lsymL3qU8D9JZg6QobD3s3LoA%3D%3D HTTP/1.1': 3,\n",
       " 'GET /2018CUMCM-AB.rar?nsukey=XqhvAC1ZP4N4dzXAQtNXrGGkm85IaFnZuiZVoG9IkVVeHWj2sexRM3UVgE483UjUNZhuMWhhCx6UMTYc5H0e2BFZ9znyY2F3o93ZFJfmt63cv4Cc0g91jGZqb2Bfbsrv8BTZmBoZoglcITMbU2pcVbEVOE3pjI538UlPnxBfFIqgoLJy0axRyX42BMB5nGKq3lsymL3qU8D9JZg6QobD3s3LoA3D3D HTTP/1.1': 3,\n",
       " 'GET /CUMCM2018.exe?nsukey=2BEmC20U5GaAE2FmRz6ipFr7f6BCb5R2FT07QotSTkLND0trzhUZKRCala93NI0a9mOtoX61gDU2NtlOX6pbmJy6jWtFhP1y0QbhfvM4ZvXw4upn8UO1GQOI7l8ZmkPniC2F9E8tXaEYb9umh40UViA4D0H635hVx509r2BMnp1RvG63z2TJBrbCGW72nPSBH0wX9R1uVbk56UAJwShgNFWbJgw3D3D HTTP/1.1': 2,\n",
       " 'GET / HTTP/1.1': 2,\n",
       " 'GET /CUMCM2018.exe?nsukey=%2BEmC20U5GaAE%2FmRz6ipFr7f6BCb5R%2FT07QotSTkLND0trzhUZKRCala93NI0a9mOtoX61gDU2NtlOX6pbmJy6jWtFhP1y0QbhfvM4ZvXw4upn8UO1GQOI7l8ZmkPniC%2F9E8tXaEYb9umh40UViA4D0H635hVx509r%2BMnp1RvG63z2TJBrbCGW72nPSBH0wX9R1uVbk56UAJwShgNFWbJgw%3D%3D HTTP/1.1': 2}"
      ]
     },
     "execution_count": 62,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "get_method = dict(thh_log['get'].value_counts())\n",
    "get_method"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 69,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "25\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "{'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36': 51,\n",
       " 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36 Edge/17.17134': 36,\n",
       " 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.75 Safari/537.36': 27,\n",
       " 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36': 26,\n",
       " 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36 Edge/16.16299': 21,\n",
       " 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36': 12,\n",
       " 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/6.2.4094.1 Safari/537.36': 12,\n",
       " 'Mozilla/5.0 (Linux; Android 8.1; BLA-AL00 Build/HUAWEIBLA-AL00; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/57.0.2987.132 MQQBrowser/6.2 TBS/044207 Mobile Safari/537.36 MicroMessenger/6.7.2.1340(0x2607023A) NetType/4G Language/zh_CN': 11,\n",
       " 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36': 11,\n",
       " 'Mozilla/5.0 (Windows NT 10.0; WOW64; rv:62.0) Gecko/20100101 Firefox/62.0': 9,\n",
       " 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36': 9,\n",
       " 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.26 Safari/537.36 Core/1.63.6726.400 QQBrowser/10.2.2265.400': 9,\n",
       " 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36': 9,\n",
       " 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:61.0) Gecko/20100101 Firefox/61.0': 8,\n",
       " 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.221 Safari/537.36 SE 2.X MetaSr 1.0': 6,\n",
       " 'Mozilla/5.0 (Linux; Android 5.1; OPPO A37m Build/LMY47I; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/63.0.3239.83 Mobile Safari/537.36 T7/10.12 baiduboxapp/10.12.0.12 (Baidu; P1 5.1)': 6,\n",
       " 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.81 Safari/537.36': 6,\n",
       " 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36': 6,\n",
       " 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.90 Safari/537.36 2345Explorer/9.4.2.17629': 6,\n",
       " 'Mozilla/5.0 (iPhone; CPU iPhone OS 7_0_2 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) CriOS/30.0.1599.12 Mobile/11A501 Safari/8536.25 MicroMessenger/6.1.0': 5,\n",
       " 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36 MicroMessenger/6.5.2.501 NetType/WIFI WindowsWechat QBCore/3.43.901.400 QQBrowser/9.0.2524.400': 4,\n",
       " 'Mozilla/5.0 (iPhone; CPU iPhone OS 11_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E216 QQ/7.7.8.421 V1_IPH_SQ_7.7.8_1_APP_A Pixel/750 Core/UIWebView Device/Apple(iPhone 6s) NetType/WIFI QBWebViewType/1': 3,\n",
       " 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36 Edge/15.15063': 3,\n",
       " 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.26 Safari/537.36 Core/1.63.5514.400 QQBrowser/10.1.1628.400': 2,\n",
       " 'Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9b4) Gecko/2008030317 Firefox/3.0b4': 2}"
      ]
     },
     "execution_count": 69,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "browser_type = dict(thh_log['browser'].value_counts())\n",
    "print(len(browser_type))\n",
    "#print(browser_type)\n",
    "browser_type"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 70,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "5\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "{'http://cumcm.cnki.net/cumcm//studentHome/studentHome': 201,\n",
       " 'http://cnki.cdn.bcebos.com/CUMCM2018.exe': 42,\n",
       " '-': 39,\n",
       " 'http://cnki.cdn.bcebos.com/2018CUMCM-AB.rar': 15,\n",
       " 'http://cnki.cdn.bcebos.com/2018CUMCM-AB.rar?nsukey=XqhvAC1ZP4N4dzXAQtNXrGGkm85IaFnZuiZVoG9IkVVeHWj2sexRM3UVgE483UjUNZhuMWhhCx6UMTYc5H0e%2BFZ9znyY%2F3o93ZFJfmt63cv4Cc0g91jGZqb%2Bfbsrv8BTZmBoZoglcITMbU2pcVbEVOE3pjI538UlPnxBfFIqgoLJy0axRyX4%2BMB5nGKq3lsymL3qU8D9JZg6QobD3s3LoA%3D%3D': 3}"
      ]
     },
     "execution_count": 70,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "url_type = dict(thh_log['url'].value_counts())\n",
    "print(len(url_type))\n",
    "#print(url_type)\n",
    "url_type"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 79,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "9\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "{'-': 271,\n",
       " '__guid=141700960.4315215346076913000.1536750087490.9688; monitor_count=1': 6,\n",
       " 'lang=zh': 5,\n",
       " '__guid=141700960.2174463798317252900.1536748157769.7764; monitor_count=6': 3,\n",
       " '__guid=141700960.4122941879506484000.1536749642949.692; monitor_count=3': 3,\n",
       " '__guid=141700960.887040413421089500.1536750165449.4753; monitor_count=1': 3,\n",
       " '__guid=141700960.1971321614214163200.1536750259720.569; monitor_count=1': 3,\n",
       " '__guid=141700960.2294804920719535600.1536750059369.6423; monitor_count=1': 3,\n",
       " '__guid=141700960.3445662407389419500.1536749887223.2832; monitor_count=6': 3}"
      ]
     },
     "execution_count": 79,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "guid_type = dict(thh_log['guid'].value_counts())\n",
    "print(len(guid_type))\n",
    "#print(browser_type)\n",
    "guid_type"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 88,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<BarContainer object of 9 artists>"
      ]
     },
     "execution_count": 88,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXEAAAD0CAYAAABtjRZ7AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAEfBJREFUeJzt3WtsU/Ufx/HP2coybYc4R5xjjKs3mIhLEcQBmgVnMIqayRhkRIYaiQ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tlbDhg0Lyz7Cobq6ukNDIHE6pTXJycktvki4du1aSdKECRN0/PjxjhpL0qmv24oVKyK+T6Mj/vDDD3f0CGfUHNFw2LFjh/r06aNnnnlGPp9PH374oZqvR598QfCiiy6S3++Xz+dTYmKidu/erV69ep3xSLy6ulozZ87UypUrWxxVReJC44033qj169crLy9PaWlpampq0rJlyzRy5MhOE/H6+nqVl5ef8oaHziMrK0sbNmzQl19+qaFDh0r661RgbW1th10g70hGR7yzaf5RKiYmRn6/X3PmzDnno3BJuuqqq+T1ejVhwgTFxcWpd+/eOnz48GnXjYmJ0bx583TvvfcqISFBtm23+hnTBQsWqKGhQQsXLlQwGNQll1yiESNGnPPMp+NyubRs2TI98cQTCgaD8vv9uvHGGzVp0qSI7K+tTnzdAoGACgsL1b9//04x04k2bNgQln9PpnM6nVq7dq1WrlypFStW6Pjx43I4HCotLQ3rdShT8BHD/6D169dr6tSpiouL06xZs5SZmanbb7+9o8cCEAEcif8HOZ1OTZgwQfHx8erVq1eHfuYZQGRxJA4ABuPXswGAwYg4ABiMiAOAwYg4ABiMiAOAwYg4ABjs/yA0Goi/wejxAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "%matplotlib inline\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "plt.style.use('seaborn-white')\n",
    "\n",
    "guid_type={'-': 271,\n",
    " '__guid=141700960.4315215346076913000.1536750087490.9688; monitor_count=1': 6,\n",
    " 'lang=zh': 5,\n",
    " '__guid=141700960.2174463798317252900.1536748157769.7764; monitor_count=6': 3,\n",
    " '__guid=141700960.4122941879506484000.1536749642949.692; monitor_count=3': 3,\n",
    " '__guid=141700960.887040413421089500.1536750165449.4753; monitor_count=1': 3,\n",
    " '__guid=141700960.1971321614214163200.1536750259720.569; monitor_count=1': 3,\n",
    " '__guid=141700960.2294804920719535600.1536750059369.6423; monitor_count=1': 3,\n",
    " '__guid=141700960.3445662407389419500.1536749887223.2832; monitor_count=6': 3}\n",
    "\n",
    "guid_type_alias={'-': 271,\n",
    " 'B': 6,\n",
    " 'lang=zh': 5,\n",
    " 'C': 3,\n",
    " 'D': 3,\n",
    " 'E': 3,\n",
    " 'F': 3,\n",
    " 'G': 3,\n",
    " 'H': 3}\n",
    "\n",
    "\n",
    "x = []\n",
    "y =[]\n",
    "for k,v in guid_type_alias.items():\n",
    "    x.append(k)\n",
    "    y.append(v)\n",
    "# print(x)\n",
    "# print(y)\n",
    "\n",
    "plt.bar(x , y, width=0.3 , color='r')\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 73,
   "metadata": {},
   "outputs": [
    {
     "ename": "TypeError",
     "evalue": "'list' object is not callable",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-73-ebb56bcca181>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m      7\u001b[0m     \u001b[1;32mreturn\u001b[0m \u001b[0mdict1\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      8\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 9\u001b[1;33m \u001b[0mguid_num\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mgetlistnum\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mthh_log\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m'guid'\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m     10\u001b[0m \u001b[0mguid_num\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32m<ipython-input-73-ebb56bcca181>\u001b[0m in \u001b[0;36mgetlistnum\u001b[1;34m(li)\u001b[0m\n\u001b[0;32m      1\u001b[0m \u001b[1;32mdef\u001b[0m \u001b[0mgetlistnum\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mli\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;31m#这个函数就是要对列表的每个元素进行计数\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 2\u001b[1;33m     \u001b[0mli\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mlist\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mli\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m      3\u001b[0m     \u001b[0mset1\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mset\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mli\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      4\u001b[0m     \u001b[0mdict1\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;33m{\u001b[0m\u001b[1;33m}\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      5\u001b[0m     \u001b[1;32mfor\u001b[0m \u001b[0mitem\u001b[0m \u001b[1;32min\u001b[0m \u001b[0mset1\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;31mTypeError\u001b[0m: 'list' object is not callable"
     ]
    }
   ],
   "source": [
    "def getlistnum(li):#这个函数就是要对列表的每个元素进行计数 \n",
    "    li = list(li)    \n",
    "    set1 = set(li)    \n",
    "    dict1 = {}    \n",
    "    for item in set1:        \n",
    "        dict1.update({item:li.count(item)})    \n",
    "    return dict1\n",
    "\n",
    "guid_num = getlistnum(thh_log['guid'])\n",
    "guid_num"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
